package com.oocl.pmsystem.model;

import com.oocl.pmsystem.bean.Command;
import com.oocl.pmsystem.bean.comparator.SuperComparator;
import com.oocl.pmsystem.bean.condition.Condition;
import com.oocl.pmsystem.bean.condition.UpdateCondition;

/**
 * 数据存取能力
 * @author WUJA13
 *
 * @param <T>
 */
public interface DBConnection<T> {

		///连接（初始化）
		public boolean connect();
	
		///增
		public boolean add(T t);
		
		///删
		public T[] query(Condition<T> condition);
		
		//查
		public boolean delete(Condition<T> condition);
		
		//改
		public boolean update(UpdateCondition<T> condition);

		//清空数据
		public void clear();
		
		//排序
		public T[] sort(SuperComparator<T> superComparator);
}
